package com.sinog.core.model;

import org.jfree.chart.JFreeChart;

/**
 * @desc 报表实体类
 * @author -
 * @date -
 */
public class ChartConfig {

    public String id;
    private int sheetId;
    public String chartType;
    public String title;
    private int width;
    private int height;
    /**
     * 制表年份
     */
    private int tableYear;
    /**
     * 开始统计年份
     */
    private int startYear;
    public JFreeChart chart;

    public int getSheetId() {
        return sheetId;
    }

    public void setSheetId(String sheetId) {
        if(null == sheetId || sheetId.isEmpty()) {
            this.sheetId = -1;
        } else {
            this.sheetId = (int)Float.parseFloat(sheetId);
        }
    }

    public int getHeight() {
        return height;
    }

    public void setHeight(String height) {
        if(null == height || height.isEmpty()) {
            this.height = 600;
        } else {
            this.height = (int)Float.parseFloat(height);
        }
    }

    public int getTableYear() {
        return tableYear;
    }

    public void setTableYear(String tableYear) {
        if(null == tableYear || tableYear.isEmpty()) {
            this.tableYear = -1;
        } else {
            this.tableYear = (int)Float.parseFloat(tableYear);
        }
    }

    public int getStartYear() {
        return startYear;
    }

    public void setStartYear(String startYear) {
        if(null == startYear || startYear.isEmpty()) {
            this.startYear = -1;
        } else {
            this.startYear = (int)Float.parseFloat(startYear);
        }
    }

    public int getWidth() {
        return width;
    }

    public void setWidth(String width) {
        if(null == width || width.isEmpty()) {
            this.width = 400;
        } else {
            this.width = (int)Float.parseFloat(width);
        }
    }

    @Override
    public String toString() {
        return id + "|" + sheetId + "|" + chartType + "|" + title + "|" + width + "|" + height + "|" + tableYear + "|" + startYear;
    }
}